﻿<%@ Page Title="资源分配-RBAC" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Privilege.aspx.cs" Inherits="RBAC.Administry.Role.Privilege" %>

<%@ Register Src="~/Control/EmptyData.ascx" TagName="EmptyData" TagPrefix="uc" %>
<%@ Register Src="~/control/ActionReport.ascx" TagName="ActionReport" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../style/css/jquery.jgrowl.css" rel="stylesheet" type="text/css" />
    <script src="../script/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="../script/jquery.jgrowl_compressed.js" type="text/javascript"></script>
    
    <script type="text/javascript">
        function assigned() {
            $.jGrowl("资源分配成功!", { life: 1500 });
        }
        function unassigned() {
            $.jGrowl("已解除资源分配!", { life: 1500 });
        }
    </script>
    
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="main" runat="server">
    <asp:ScriptManager runat="server" />
    <h2 class="pagetitle link">资源分配</h2>
    <p>
        <uc:ActionReport ID="report" runat="server" />
    </p>
    <p>
        <dl>
            <dt>角色:</dt>
            <dd><asp:Literal ID="role" runat="server" Text="未指定" /></dd>
            <dt>描述:</dt>
            <dd><asp:Literal ID="display" runat="server" Text="未指定" /></dd>
        </dl>
    </p>
    
    <p>
        <asp:GridView ID="grid" runat="server" DataKeyNames="ID" 
            AutoGenerateColumns="false" 
            CssClass="stylized full" 
            AllowPaging="true"
            PageSize="15" 
            onpageindexchanging="grid_PageIndexChanging" >
            <EmptyDataTemplate>
                <uc:EmptyData ID="EmptyData1" runat="server" />
            </EmptyDataTemplate>
            <Columns>
                <asp:TemplateField HeaderText="分配">
                    <ItemTemplate>
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <asp:CheckBox ID="assign" runat="server" 
                                    AutoPostBack="true" 
                                    Checked='<%# IsAssign(GetDataItem()) %>'
                                    OnCheckedChanged="assign_Changed"/>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="资源" DataField="ID" />
                <asp:BoundField HeaderText="描述" DataField="Display" />
            </Columns>
        </asp:GridView>
    </p>
    <p>
        <a href="List.aspx">&laquo;&nbsp;返回角色清单</a>
    </p>
    <asp:UpdatePanel ID="scriptUpdatePanel" runat="server" />
</asp:Content>
